package com.guoxin.factory.simplefactory.pizzastore.order;

import com.guoxin.factory.TypeUtils;
import com.guoxin.factory.simplefactory.pizzastore.pizza.CheesePizza;
import com.guoxin.factory.simplefactory.pizzastore.pizza.GreekPizza;
import com.guoxin.factory.simplefactory.pizzastore.pizza.PepperPizza;
import com.guoxin.factory.simplefactory.pizzastore.pizza.Pizza;

/**
 * @author guoxin
 * @date 2019/8/15
 */
public class OrderPizza {

	public OrderPizza() {
		label: do {
			Pizza pizza;
			String type = TypeUtils.getType();
			switch (type) {
			case "cheese":
				pizza = new CheesePizza("奶酪pizza");
				break;
			case "greek":
				pizza = new GreekPizza("希腊pizza");
				break;
			case "pepper":
				pizza = new PepperPizza("胡椒pizza");
				break;
			default:
				break label;
			}
			pizza.show();
		} while (true);
	}

}
